<?php 
	$seller = \Session::get('seller', false); 
?>
<div class="row">
	<div class="col-xs-12">
		<!-- PAGE CONTENT BEGINS -->
		<form class="form-horizontal" method="post" role="form">
			<!-- #section:elements.form -->
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 活动标题 </label>
				<div class="col-sm-9">
					<input type="text" class="col-xs-10 col-sm-5 col-md-7" id="title" name="title" placeholder="活动标题" value="<?php echo isset($item) && $item ? $item->title : ''; ?>">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 缩略图 </label>
				<div class="col-sm-9">					
					<div class="input-group col-xs-10 col-sm-7">
						<input type="text" class="form-control" id="thumbnail" name="thumbnail" placeholder="外链地址或上传本地图片" value="<?php echo isset($item) && $item ? $item->thumbnail : ''; ?>" data-toggle="modal" data-target="#modal-upload">
						<span class="input-group-addon">
							<a href="#" data-panel="qrcode" data-toggle="modal" data-target="#modal-upload"><i class="ace-icon fa fa-upload"></i></a>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 活动详情 </label>
				<div class="col-sx-7 col-sm-7 col-md-7">
					<textarea class="" id="body" name="body" placeholder="活动内容" role="editor" style="height:300px;"><?php echo isset($item) && $item ? $item->body : ''; ?></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 截止报名时间 </label>
				<div class="col-sm-9">
					<input type="text" role="datepicker" class="col-xs-10 col-sm-5 col-md-7" id="reg_at" name="reg_at" placeholder="截止报名时间"  value="<?php echo isset($item) && $item && $item->reg_at ? date('Y-m-d H:i:s', $item->reg_at) : ''; ?>">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 活动开始时间 </label>
				<div class="col-sm-9">
					<input type="text" role="datepicker" class="col-xs-10 col-sm-5 col-md-7" id="start_at" name="start_at" placeholder="活动开始时间"  value="<?php echo isset($item) && $item && $item->start_at ? date('Y-m-d H:i:s', $item->start_at) : ''; ?>">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 活动结束时间 </label>
				<div class="col-sm-9">
					<input type="text" role="datepicker" class="col-xs-10 col-sm-5 col-md-7" id="end_at" name="end_at" placeholder="活动结束时间"  value="<?php echo isset($item) && $item->end_at ? date('Y-m-d H:i:s', $item->end_at)  : ''; ?>">
				</div>
			</div>

			<div class="clearfix form-actions">
				<div class="col-md-offset-3 col-md-9">
					<button class="btn btn-info" type="submit">
						<i class="ace-icon fa fa-check bigger-110"></i>
						提交
					</button>

					&nbsp; &nbsp; &nbsp;
					<button class="btn" type="reset">
						<i class="ace-icon fa fa-undo bigger-110"></i>
						重置
					</button>
				</div>
			</div>
		</form><!-- PAGE CONTENT ENDS -->
	</div><!-- /.col -->
</div><!-- /.row -->

<?php echo render('ace/public/alert_message'); ?>

<script type="text/javascript">
  var path = 'activity';
  var imgpanel = '';
  
  function callback(file, data){
      var json = eval('(' + data + ')');
      if(json.status == 'succ'){
          $("#thumbnail").val(json.data);
      }else{
          alert(json.msg);
      }
  }
</script>
<?php echo render('tools/upload'); ?>

<script type="text/javascript" src="/assets/third-party/editor/kindeditor-min.js"></script>
<script charset="utf-8" src="/assets/third-party/editor/lang/zh_CN.js"></script>
<script type="text/javascript">
$(function(){
    KindEditor.ready(function(K){
        window.editor = K.create('textarea[role="editor"]');
    });
});
</script>

<link rel="stylesheet" type="text/css" href="/assets/third-party/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css">
<script type="text/javascript" src="/assets/third-party/bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="/assets/third-party/bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">
$(function(){
	$('input[role="datepicker"]').datetimepicker({
		language: 'zh-CN'
	});
});
</script>

